<template>
  <div class="chart" ref="chart"></div>
</template>
<script>
import * as echarts from 'echarts';
export default {
  props:{
    msg:Object
  },
  data() {
    return {
      
    }
  },
  mounted() {
    this.$nextTick(()=>{ 
      this.chartbar();
    });
  },
  methods:{
    chartbar (){
      let echart = echarts.init(this.$refs.chart)
      echart.setOption(this.msg);
      window.addEventListener("resize",()=>{
        echart.resize();
      })
    },
  }
}
</script>
